package Test;

import java.util.*;

public class ListTest {
	public static void main(String[] args) {
		List<Integer> arraylist = new ArrayList<>();
		for(int i=1;i<=10;i++) {
			arraylist.add(i);
		}
		//删除被3整除的数
		Iterator<Integer> it = arraylist.iterator();
		while(it.hasNext()) {
			Integer element = it.next();
			if(element%3==0) it.remove();
		}
		//打印剩余元素
		System.out.println(arraylist);
	}
}
